﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Maticsoft.Common;
using Maticsoft.Model;
using Maticsoft.DAL;
using System.Data;
using System.Data.SqlClient;

namespace Maticsoft.BLL
{
    public class major
    {
        private majorDb majorin = null;
        public major()
        {
            majorin = new majorDb();
        }
        #region 返回所有的学院名字
        /// <summary>
      /// 返回所有的学院名字
      /// </summary>
      /// <returns></returns>
        public DataTable selectAllCollName()
        {
            //TODO:返回所有的学院名字
            return majorin.selectAllCollName();
        }
        #endregion
        /// <summary>
        /// 返回所有的专业名字
        /// </summary>
        /// <returns></returns>
        public DataTable selectAllMajName(string  m)
        {
            //TODO:返回所有的专业名字
            return majorin.selectAllMajName(m);
        }
        public DataTable selectAllMajName()
        {
            //TODO:返回所有的专业名字
            return majorin.selectAllMajName();
        }
        /// <summary>
        /// 返回所有的课程信息，根据学院和专业
        /// </summary>
        /// <param name="colleage_name"></param>
        /// <param name="major_name"></param>
        /// <returns></returns>
        public DataTable selectAllKechengByCollAndMaj(string colleage_name, string major_name)
        {
            //TODO:返回所有的课程信息，根据学院和专业
            return majorin.selectAllKechengByCollAndMaj(colleage_name, major_name);
        }
        /// <summary>
        /// 根据课程id修改课程信息
        /// </summary>
        /// <param name="km"></param>
        /// <returns></returns>
        public bool updateKechengInfo(kechengModel km)
        {
            //TODO:根据课程id修改课程信息
            return majorin.updateKechengInfo(km);
        }
        /// <summary>
        /// 通过课程的ID进行更新课程信息
        /// </summary>
        /// <param name="kecheng_name"></param>
        /// <param name="a"></param>
        /// <param name="c"></param>
        /// <param name="d"></param>
        /// <param name="e"></param>
        /// <param name="f"></param>
        /// <returns></returns>
        public bool updateKEchenginfo2(string kecheng_name, string a, string c, string d, string e, string f)
        {
            //TODO:通过课程的ID进行更新课程信息
            return majorin.updateKEcehnginfo2(kecheng_name,a,c,d,e,f);
        }
        /// <summary>
        /// 通过课程ID查询所有的课程信息
        /// </summary>
        /// <param name="kecheng_name"></param>
        /// <returns></returns>
        public DataTable selAllKechengInfoByKeId(string kecheng_name)
        {
            //TODO:通过课程ID查询所有的课程信息
            return majorin.selAllKechengInfoByKeId(kecheng_name);
        }
        /// <summary>
        /// 根据课程的ID删除课程的信息
        /// </summary>
        /// <param name="kecheng_id"></param>
        /// <returns></returns>
        public bool Delete(int kecheng_id)
        {
            //TODO:根据课程的ID删除课程的信息
            return majorin.Delete(kecheng_id);
        }
        /// <summary>
        /// 通过专业ID，插入所有的课程信息
        /// </summary>
        /// <param name="kecheng_name"></param>
        /// <param name="a"></param>
        /// <param name="c"></param>
        /// <param name="d"></param>
        /// <param name="e"></param>
        /// <param name="f"></param>
        /// <param name="major_id"></param>
        /// <returns></returns>
        public bool insertKechengInfo(string kecheng_name, string a, string c, string d, string e, string f, int major_id)
        {
            //TODO:通过专业ID，插入所有的课程信息
            return majorin.insertKechengInfo(kecheng_name,a,c,d,e,f,major_id);
        }
        /// <summary>
        /// 插入管理员信息
        /// </summary>
        /// <param name="user_name"></param>
        /// <param name="password"></param>
        /// <param name="phone"></param>
        /// <returns></returns>
        public bool insertAdminInfo(string user_name, string password, string phone)
        {
            //TODO:插入管理员信息
            return majorin.insertAdminInfo(user_name,password,phone);
        }
        /// <summary>
        /// 查询所有的管理员信息
        /// </summary>
        /// <returns></returns>
        public DataTable selectAllAdminInfo()
        {
            return majorin.selectAllAdminInfo();
        }
        /// <summary>
        /// 通过管理员id来删除管理员
        /// </summary>
        /// <param name="admin_id"></param>
        /// <returns></returns>
        public bool DeleteAdminInfo(int admin_id)
        {
            return majorin.DeleteAdminInfo(admin_id);
        }
        public bool updateAdminInfo(string zhanghao, string mima, string phone)
        {
            return majorin.updateAdminInfo(zhanghao,mima,phone);
        }
        public DataTable selectAdminNameIsCunZai(string admininfo)
        {
            return majorin.selectAdminNameIsCunZai(admininfo);
        }
    }
}
